<?php
namespace app\home\model;
use think\Model;
class User extends Model
{
    protected $autoWriteTimestamp = 'datetime';//自动生成当前时间戳

    public function setPasswordAttr($v)
    {
        return password_hash($v,PASSWORD_BCRYPT);
    }
}

